home *** CD-ROM | disk | FTP | other *** search
- ;--------------------------------------------------------------------------
- ;
- ; 29ROWS.ASM, v1.0, Peter Nelson. This program sets the 6845 chip in
- ; the CGA card to 29 rows. (It isn't difficult to set it to 90 columns,
- ; but no programs are compatible with it besides DOS.) The program
- ; then saves the interrupt vector for IL-10xH in memory, and redirects
- ; the IL-10xH vector to point to my routine. The interrupt routine checks
- ; to see if the WRITE_TTY call is being used, and if not, flow is passed
- ; to the normal BIOS routines. If so, then I take over, and only scroll
- ; after 29 lines, instead of 25. This program was compiled using Eric
- ; Isaacson's A86 compiler. If you read the code, you will find a small
- ; bug of the compiler. It ignored the FAR designation in my JMP command
- ; and I was forced to put the code in directly. Still, it's the best
- ; compiler for the money (ShareWare). If you like this program, please
- ; don't bother sending any money. You and I both know it isn't worth
- ; anything. Finis, Mongo.
- ;
- ; Note: This program remains resident in memory and occupies 704 bytes.
- ;
-
-
-
- ACTIVE_PAGE EQU 040:0062xH ; Video data area
- CRT_COLS EQU 040:004AxH ; Video data area
- CRT_MODE EQU 040:0049xH ; Video data area
-
-
- INT_PRINT EQU INT 017h ; BIOS interrupt to print to printer
- INT_SCREEN EQU INT 010h ; BIOS interrupt for screen functions
- TIMER EQU 040h ; Used by BEEP routine
- PORT_B EQU 061h ; Used by BEEP routine
- BELL EQU 07h ; Bell character for screen
- BKSP EQU 08h ; Backspace character for screen
- CR EQU 0Dh ; Carriage return char for printer
- LF EQU 0Ah ; Line feed char for printer
- FF EQU 0Ch ; Form feed char for printer
- MSDOS EQU INT 021xH ; DOS software interrupt
- TTY EQU 0ExH ; BIOS 10h Interrupt indicates tty_write
-
-
-
- START: JMP PROGRAM
-
-
- INT10VECTOR DW ????
- INT10VECTOR2 DW ????
- SCREENLEN DB 28xD
- CREATOR DB '29ROWS, v1.0, by Peter Nelson. Hi there!'
-
-
- PROGRAM:
- MOV DX, 03D4xH ; Set up the 6845 graphics chip
- MOV AL, 06
- OUT DX, AL
- INC DX
- MOV AL, [SCREENLEN]
- INC AL
- OUT DX, AL
- DEC DX
- MOV AL, 07
- OUT DX, AL
- INC DX
- MOV AL, [SCREENLEN]
- INC AL
- INC AL
- OUT DX, AL
-
-
- SETVECTORS:
- MOV AH, 035xH
- MOV AL, 010xH
- MSDOS
- MOV INT10VECTOR, BX
- MOV INT10VECTOR2, ES
-
- MOV DS, CS ; Redirect IL10h
- MOV DX, OFFSET INT10_OE ; to the beginning of my
- MOV AH, 025xH ; program
- MOV AL, 010xH
- MSDOS
-
- MOV DX, OFFSET VERYEND
- INT 027xH
-
-
-
- ;--------------------------------------------------------------------------
- ; Here is the start of the interrupt intercept routine
-
- INT10_OE:
- CMP AH, TTY
- IF NE JMP NOTMINE
-
- STI
- CLD
- PUSH AX, BP, BX, CX, DI, DS, DX, ES, SI
- PUSHF
-
-
- WRITE_TTY:
- ;--------------------------------------------------------------------------
- ; Here we save the registers
-
- PUSH AX, DS
-
- ;--------------------------------------------------------------------------
- ; Here we must set the [DS] reg to point to the video area
-
- PUSH AX
- MOV AX, 040xH
- MOV DS, AX
- POP AX
-
- ;--------------------------------------------------------------------------
- ; Here we get the cursor position
-
- PUSH AX
- MOV AH, 3
- MOV BH, [ACTIVE_PAGE]
- INT_SCREEN
- POP AX
-
- ;--------------------------------------------------------------------------
- ; [DX] now has the current cursor position
-
- CMP AL, BKSP
- JE U8
- CMP AL, CR
- JE U9
- CMP AL, LF
- JE U10
- CMP AL, BELL
- JE U11
-
- ;--------------------------------------------------------------------------
- ; Write the character to the screen
-
- MOV AH, 0AxH
- MOV CX, 1
- INT_SCREEN
-
- ;--------------------------------------------------------------------------
- ; Position the cursort for next char
-
- INC DL
- CMP DL, [CRT_COLS]
- JNZ U7
- MOV DL, 0
- CS CMP DH, [SCREENLEN]
- JNZ U6
-
- ;--------------------------------------------------------------------------
- ; Scroll Required
-
- U1:
- MOV AH, 2
- INT_SCREEN
-
- ;--------------------------------------------------------------------------
- ; Determine the value to fill with during scroll
-
- MOV AL, [CRT_MODE]
- CMP AL, 4
- JC U2
- CMP AL, 7
- MOV BH, 0
- JNE U3
-
- U2:
- MOV AH, 8
- INT_SCREEN
- MOV BH, AH
-
- U3:
- MOV AX, 0601xH
- SUB CX, CX
- CS MOV DH, [SCREENLEN]
- MOV DL, [CRT_COLS]
- DEC DL
-
- U4:
- INT_SCREEN
-
- U5:
- POP DS, AX
- JMP VIDEO_RETURN
-
- U6:
- INC DH
-
- U7:
- MOV AH, 2
- JMP U4
-
- ;--------------------------------------------------------------------------
- ; BackSpace Found
-
- U8:
- CMP DL, 0
- JE U7
- DEC DL
- JMP U7
-
- ;--------------------------------------------------------------------------
- ; Carriage Return Found
-
- U9:
- MOV DL, 0
- JMP U7
-
- ;--------------------------------------------------------------------------
- ; Line Feed Found
-
- U10:
- CS CMP DH, [SCREENLEN]
- JNE U6
- JMP U1
-
- ;--------------------------------------------------------------------------
- ; Bell Found
-
- U11:
- PUSH AX, CX
- MOV AL, 10110110xB
- OUT TIMER+3, AL
- MOV AX, 0777h
- OUT TIMER+2, AL
- MOV AL, AH
- OUT TIMER+2, AL
- IN AL, PORT_B
- MOV AH, AL
- OR AL, 03h
- OUT PORT_B, AL
- MOV CX, 0000h
- LOOP $-1
- MOV AL, AH
- OUT PORT_B, AL
- POP CX, AX
-
- JMP U5
-
-
- ;--------------------------------------------------------------------------
-
-
- EXIT:
- VIDEO_RETURN:
- POPF
- POP SI, ES, DX, DS, DI, CX, BX, BP, AX
-
- IRET
-
-
-
-
- ;---------------------------------------------------------------------------
- NOTMINE:
- DB 02ExH ; Assembler bug, need to
- ; CS: ; manually enter the code
- DB 0FFxH, 02ExH, 03xH, 01xH ; here.
- ; JMP FAR [INT10VECTOR] ;
- ;--------------------------------------------------------------------------
-
-
-
- DB 00xH
- VERYEND: